#ifndef __MATCHER_BLOOM_H
#define __MATCHER_BLOOM_H

#define NELEM(N,ELEMPER) ((N + (ELEMPER) - 1) / (ELEMPER))
#define BITS_SZ 8

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <stdlib.h>

#include <stddef.h>

#include "clamav.h"

typedef enum boolean {FALSE, TRUE} boolean;
typedef size_t elem_t;
// typedef unsigned char bit;

bit *ba_new(const elem_t nelems);
void ba_assign(bit arr[], elem_t elem, const boolean value);

// functions for our bloom filter
void init_bloom_filter(bit *to_init);
void set_bloom_filter_value(bit *filter_to_set,unsigned char *string_to_hash);
boolean is_possible_match(bit *filter_to_search, 
			  unsigned char* string_to_match);

void setup_bloom_structures(bit** bloom_filter,  
			    struct cli_bloom_node*** hash_table);
void insert_into_hash_table(struct cli_bloom_node* hash_table[],
			    const char *virname, const char *hexsig, 
			    unsigned short type);


#endif  // __MATCHER_BLOOM_H
